<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:DentalGUIHelper;assembly=DentalConfig">

    <!-- ========================= -->
    <!--        Converters         -->
    <!-- ========================= -->
    <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
    
    <Style x:Key="WizardContentAndTextToggleButtonStyle" TargetType="{x:Type local:ContentAndTextToggleButton}">
        <Setter Property="Background" Value="Green" />
        <Setter Property="Foreground" Value="{DynamicResource BlackBrush}" />
        <Setter Property="BorderThickness" Value="2" />
        <Setter Property="Width" Value="Auto" />
        <Setter Property="Height" Value="Auto" />
        <Setter Property="HorizontalAlignment" Value="Stretch" />
        <Setter Property="HorizontalContentAlignment" Value="Left" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="TextDock" Value="Right" />
        <Setter Property="TextMargin" Value="5" />
        <Setter Property="FontSize" Value="{DynamicResource ButtonFontSize}" />
        <Setter Property="FontFamily" Value="Segoe UI" />
        <Setter Property="ContentWidth" Value="Auto" />
        <Setter Property="ContentHeight" Value="Auto" />
        <Setter Property="RenderTransformOrigin" Value="0.5,0.5" />
        <Setter Property="Margin" Value="0" />

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:ContentAndTextToggleButton}">
                    <DockPanel Name="contentContainer" Background="Transparent" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                        <!-- Content (= Image) with circle around it -->
                        <Grid x:Name="grid" Background="#8E8E8E" Margin="3" DockPanel.Dock="Left">
                            <Viewbox Width="{TemplateBinding ContentWidth}" Height="{TemplateBinding ContentHeight}" Margin="4,3">
                                
                                <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                                  SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                                  VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                            </Viewbox>
                        </Grid>

                        <!-- Text -->
                        <TextBlock x:Name="PART_TextBlock" Text="{TemplateBinding Text}" Foreground="{TemplateBinding Foreground}"
                                   Margin="{TemplateBinding TextMargin}" TextWrapping="WrapWithOverflow"
                                   Visibility="{TemplateBinding ShowText, Converter={StaticResource BooleanToVisibilityConverter}}"
                                   HorizontalAlignment="Left" VerticalAlignment="Center" />
                    </DockPanel>

                    <ControlTemplate.Triggers>
                        <Trigger Property="TextDock" Value="Right">
                            <Setter TargetName="grid" Property="DockPanel.Dock" Value="Left" />
                        </Trigger>
                        <Trigger Property="TextDock" Value="Left">
                            <Setter TargetName="grid" Property="DockPanel.Dock" Value="Right" />
                        </Trigger>
                        <Trigger Property="TextDock" Value="Top">
                            <Setter TargetName="grid" Property="DockPanel.Dock" Value="Bottom" />
                        </Trigger>
                        <Trigger Property="TextDock" Value="Bottom">
                            <Setter TargetName="grid" Property="DockPanel.Dock" Value="Top" />
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="contentContainer" Property="Background" Value="{DynamicResource GrayBrush10}" />
                        </Trigger>
                        <Trigger Property="ToggleButton.IsChecked" Value="True">
                            <Setter TargetName="contentContainer" Property="Background" Value="{DynamicResource GrayBrush5}" />
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter Property="RenderTransform">
                                <Setter.Value>
                                    <TransformGroup>
                                        <!--<ScaleTransform ScaleX="0.95" ScaleY="0.95" />-->
                                        <TranslateTransform X="1" Y="1" />
                                    </TransformGroup> 
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Opacity" Value="0.5" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


    <Style x:Key="NextStepRadioButtonStyle" TargetType="RadioButton">
        <Setter Property="Foreground" Value="Black"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderBrush" Value="Black"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="RenderTransformOrigin" Value="0.5,0.5"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RadioButton}">
                    <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                        <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True"/>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter Property="Background" Value="{DynamicResource GrayBrush10}"/>
                        </Trigger>
                        <Trigger Property="ToggleButton.IsChecked" Value="true">
                            <Setter Property="Background" Value="{DynamicResource GrayBrush5}"/>
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter Property="RenderTransform">
                                <Setter.Value>
                                <!--<ScaleTransform ScaleX="0.95" ScaleY="0.95" />-->
                                    <TranslateTransform X="1" Y="1"/>
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Opacity" Value="0.5"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
</ResourceDictionary>